package cool.houge.pig.service.auth;

import cool.houge.pig.model.AuthClient;
import cool.houge.pig.model.User;
import lombok.Builder;
import lombok.Value;
import reactor.core.publisher.Mono;

/**
 * 令牌构造.
 *
 * @author KK (kzou227@qq.com)
 */
public interface TokenPreprocess {

  /**
   * 返回授权类型.
   *
   * @return 授权类型
   */
  String grantType();

  /**
   * @param authClient
   * @param input
   * @return
   */
  Mono<ProcessPart> process(AuthClient authClient, AuthTokenInput input);

  @Value
  @Builder
  class ProcessPart {

    /** 用户信息. */
    private User user;
  }
}
